/* 添加文档页面样式 */
.add-document-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--n-color);
  padding: 0;
  overflow: hidden;
}

/* 主要内容区域 */
.content-container {
  flex: 1;
  padding: 24px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}

/* 页面标题部分 */
.page-title-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--n-border-color);
}

.page-title {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--n-text-color);
}

.knowledge-base-info {
  font-size: 14px;
  color: var(--n-text-color-2);
}

.kb-name {
  font-weight: 500;
  color: var(--n-primary-color);
}

/* 模式切换 */
.mode-switch {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

/* 文本输入区域 */
.text-input-section {
  background-color: var(--n-card-color);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

.text-input-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.full-width-input {
  width: 100% !important;
}

.markdown-preview-section {
  margin-top: 16px;
  border: 1px solid var(--n-border-color);
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background-color: var(--n-color);
  border-bottom: 1px solid var(--n-border-color);
  font-weight: 500;
}

.markdown-preview {
  padding: 16px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
}

.full-width-preview {
  width: 100% !important;
}

/* 文件上传区域 */
.file-upload-section {
  background-color: var(--n-card-color);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
  width: 100%;
}

.upload-area {
  border: 2px dashed var(--n-border-color);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background-color: var(--n-color);
  width: 100%;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--n-primary-color);
  background-color: var(--n-color-hover);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.upload-text p {
  margin: 0;
}

.upload-text a {
  color: var(--n-primary-color);
  text-decoration: none;
  font-weight: 500;
}

.upload-text a:hover {
  text-decoration: underline;
}

.upload-hint {
  font-size: 12px;
  color: var(--n-text-color-3);
}

.upload-file {
  display: flex;
  align-items: center;
  gap: 16px;
}

.upload-file-info {
  flex: 1;
  text-align: left;
}

.upload-file-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.upload-file-size {
  font-size: 12px;
  color: var(--n-text-color-3);
}

/* 内容预览区域 */
.content-preview-section {
  margin-top: 24px;
  border: 1px solid var(--n-border-color);
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
}

.content-preview {
  padding: 16px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  width: 100%;
}

.preview-content {
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
}

.preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100px;
  color: var(--n-text-color-3);
}

.non-text-file-preview {
  padding: 16px;
  background-color: var(--n-color);
  border-radius: 4px;
}

/* 操作按钮 */
.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .content-container {
    padding: 16px;
  }
  
  .text-input-section,
  .file-upload-section {
    padding: 16px;
  }
  
  .upload-area {
    padding: 24px;
  }
  
  .action-buttons {
    flex-direction: column-reverse;
  }
  
  .action-buttons .n-button {
    width: 100%;
  }
}